//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Windows.Media.Media3D;

namespace OpenLS.Chart.UI
{
    class ConeGeometryFactory : ConeGeometryFactoryBase
    {
        public ConeGeometryFactory(BarDirection direction): base(direction)
        {
            
        }

        internal override Point3D GetPosition(double theta, double value)
        {
            Bounds valueBounds = GetValueBounds(Bounds);
            double ratio = (valueBounds.High - value) / valueBounds.Delta;
            Bounds categoryBounds = GetCategoryBounds(Bounds);
            double category = categoryBounds.Mid + ratio * categoryBounds.Delta / 2 * Math.Cos(theta);
            double z = Bounds.Z.Mid + ratio * Bounds.Z.Delta / 2 * Math.Sin(theta);
            switch(Direction)
            {
                case BarDirection.Column:
                    return new Point3D(category, value, z);
                    default:
                    return new Point3D(value, category, z);
            }
        }


        protected override void AddTop(MeshGeometry3D mesh)
        {
            
        }
    }
}
